using System;
using System.Data;

namespace TimeSheetBLL.Brokers
{
	/// <summary>
	/// Summary description for ActivityBroker.
	/// </summary>
	public class ActivityBroker : Broker
	{
		public ActivityBroker() : base()
		{
			
		}

		public override DataTable SelectAll( IDBEntity entity )
		{
			string statement = "SELECT * FROM activity WHERE active > 0 ORDER BY activity_name";
			return this.data.GetTable( statement );
		}

		public override bool Delete( IDBEntity entity )
		{
			string statement = "UPDATE activity SET active = 0 WHERE activity_id = " + entity.ID;
			return this.data.ExecuteNonQuery( statement ) > 0;
		}
	}
}
